// store
import { createStore, combineReducers } from 'redux';
import countReducer from './reducers/countReducer';
import todoReducer from './reducers/todoReducer'

const mainReducer = combineReducers({
  count: countReducer,
  todo: todoReducer
});

const store = createStore(mainReducer);

// 检测 state 的变化
store.subscribe(() => {
  console.log('数据发生改变：', store.getState());
})

export default store;